<!DOCTYPE html>
<html lang="zh-CN">
<head>
    <meta charset="utf-8">
    <title>${(metadata.alias)!} ${site.name}</title>
	<meta name="keywords" content="${(metadata.alias)!} ${site.name}"/>
	<meta name="description" content="${(metadata.alias)!} ${site.name}" />
	<@tools.includePlace path="/common/697054d4-2b69-4476-b4fe-868c61316959.html"/> <#-- header -->
</head>
<body class="d-flex flex-column">
	<main class="flex-shrink-0"  data-diy="config" data-diy-id="site">
		<@tools.includePlace path="/common/0b31f69d-dc03-407b-95af-88be3db0289e.html"/> <#-- nav -->
		<!-- Page Content-->
		<section class="py-5">
			<div class="container px-5 my-5">
				<div class="card bg-light">
					<div class="card-body" data-diy="config" data-diy-id="site">
						<#if user?has_content>
						<p>${user.nickname},您已经登录了!<a href="javascript:logout();">点击这里退出登录</a></p>
						<form action="${site.dynamicPath}doLogout" method="post">
							<input type="hidden" name="userId" value="${(user.id)!}"/>
							<input type="hidden" name="returnUrl" value="${returnUrl!site.dynamicPath!}"/>
						</form>
						<#else>
						<form action="${site.dynamicPath}doRegister" method="post">
							<#if error?has_content>
								<p class="red">${springMacroRequestContext.getMessage(error,error)}</p>
							</#if>
							<p><input type="text" name="name" placeholder="用户名" title="User name" value="${name!}"/></p>
							<p><input type="text" name="nickname" placeholder="昵称" title="Nickname" value="${nickname!}"/></p>
							<p><input type="password" name="password" placeholder="密码" title="Password"/></p>
							<p><input type="password" name="repassword" placeholder="重复密码" title="Repeat password"/></p>
							<@sys.configData code="safe">
							<#if object.captcha?has_content && object.captcha?split(",")?seq_contains("register")>
							<p>
								<input name="captcha" type="text" autocomplete="off" placeholder="Captcha" title="Captcha"/>
								<img src="${site.dynamicPath}getCaptchaImage?${.now?long}" alt="captcha" onclick="this.src=this.src+'&'+new Date().getTime()"/>
							</p>
							</#if>
							</@sys.configData>
							<p>
								<input type="hidden" name="returnUrl" value="${returnUrl!}"/>
								<input type="hidden" name="clientId" value="${clientId!}"/>
								<input type="hidden" name="uuid" value="${uuid!}"/>
								<input type="submit" value="注册"/>
							</p>
							<p>已经拥有账号?<a href="login.html?clientId=${clientId!}&uuid=${uuid!}&returnUrl=${returnUrl!}">请登录</a></p>
						</form>
					</#if>
					</div>
				</div>
			</div>
		</section>
	</main>
	<script>
		var templatePath='${.current_template_name?keep_after('/')}';
	</script>
	<@tools.includePlace path="/common/704bd033-154c-40f4-a8c5-2d36c092c3fd.html"/> <#-- footer -->
	<script src="${site.sitePath}assets/js/jquery-3.6.4.min.js"></script>
	<script>
            function logout(){
				$('form[name=logout]').submit();
			}
	</script>
</body>
</html>
